package osb.map.net;
import android.annotation.SuppressLint;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

@SuppressLint("SimpleDateFormat")
public class DataPackage implements Serializable
{
	private static final long serialVersionUID = 1L;

	public DataPackage(msgType type)
	{
		this();
		this.type=type;
	}

	public DataPackage()
	{
	  	Date now = new Date(System.currentTimeMillis());
    	SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    	msgTime = format.format(now);

	}
	public msgType type=msgType.None;
	public DataUser dataUser=null;
	public DataComment dataComment=null;
	public DataPay dataPay=null;
	public DataGPS dataGPS=null;
	
	public String msgTime;
	
	@Override
	public String toString(){
		String str;
		str=type.toString();
		str+=","+msgTime;
		if(dataGPS!=null)
			str+=","+dataGPS.toString();
		return str;
		
	}
}
